package com.hxx;

import com.hxx.controller.PersonController;

import java.util.Scanner;

public class TestDemo {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        PersonController controller = new PersonController();
        boolean flag = true;
        do {
            System.out.println("1save;2show;3delete;4update;5exit;");
            int key = scanner.nextInt();
            switch (key) {
                case 1:
                    controller.addPerson(scanner);
                    break;
                case 2:
                    controller.queryPerson();
                    break;
                case 3:
                    controller.deletePerson(scanner);
                    break;
                case 4:
                    controller.updatePerson(scanner);
                    break;
                case 5:
                    flag = false;
                    break;
                default:
                    System.out.println("invalid input!");
                    break;
            }
        }while(flag);
    }
}
